package cn.platform.mapper;

import cn.platform.entity.Parent;
import cn.platform.entity.UserAccount;
import cn.platform.request.IdentifyRequest;
import cn.platform.request.ParentRequest;
import cn.platform.request.UserParentQueryDTO;
import cn.platform.response.UserParentVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface ParentMapper {
    // 登录身份验证
    List<UserAccount> identify(IdentifyRequest req);

    // 查询
    List<Parent> listParent(ParentRequest req);

    // 新增
    void insertParent(ParentRequest req);

    // 更新，用id找，其余参数为更新内容，null值不更新
    void updateParent(ParentRequest req);

    // 删除，用id找
    void deleteParent(ParentRequest req);

    Page<UserParentVO> page(UserParentQueryDTO query);

    void insert(Parent parent);

    void update(Parent parent);

    @Delete("delete from jxt_parents where id=#{id}")
    void deleteById(Integer id);

    void batchDeleteById(List<Integer> ids);
}
